<html>
<head><meta charset="utf-8"><title>save-temps · t-compiler/wg-llvm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/index.html">t-compiler/wg-llvm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html">save-temps</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="177954446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177954446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177954446">(Oct 11 2019 at 22:15)</a>:</h4>
<p>when i run <code>-Csave-temps</code>, where does the output go?</p>



<a name="177954802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177954802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177954802">(Oct 11 2019 at 22:21)</a>:</h4>
<p>to <code>--out-dir=</code></p>



<a name="177983401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983401">(Oct 12 2019 at 11:06)</a>:</h4>
<p>ugh. I get;</p>
<div class="codehilite"><pre><span></span>build/x86_64-unknown-linux-gnu/llvm/bin/llvm-dis: error: Inserted value <span class="nb">type</span> doesn<span class="s1">&#39;t match aggregate type (Producer: &#39;</span>LLVM9.0.0-rust-1.40.0-dev-8adf9bdcc<span class="s1">&#39; Reader: &#39;</span>LLVM <span class="m">9</span>.0.0-rust-1.40.0-dev-8adf9bdcc<span class="err">&#39;</span><span class="o">)</span>
</pre></div>



<a name="177983403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983403">(Oct 12 2019 at 11:06)</a>:</h4>
<p>this is of course the problem I'm trying to debug in the first place!</p>



<a name="177983407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983407">(Oct 12 2019 at 11:06)</a>:</h4>
<p>I can't figure out how to actually <em>see</em> the IR that's causing the problem</p>



<a name="177983470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983470">(Oct 12 2019 at 11:08)</a>:</h4>
<p>I've built rustc with the "Verify llvm IR" option</p>



<a name="177983475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983475">(Oct 12 2019 at 11:08)</a>:</h4>
<p>which, rather annoyingly, means that we <strong>always</strong> verify LLVM IR and it cannot be disabled</p>



<a name="177983477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983477">(Oct 12 2019 at 11:08)</a>:</h4>
<p>this in turn prevents <code>--emit llvm-ir</code> from working</p>



<a name="177983488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983488">(Oct 12 2019 at 11:08)</a>:</h4>
<p>so it's kind of hard for me to figure out what the heck is going on</p>



<a name="177983695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983695">(Oct 12 2019 at 11:14)</a>:</h4>
<p>Since this error comes from llvm-dis, does <code>--emit llvm-bc</code> work?</p>



<a name="177983719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983719">(Oct 12 2019 at 11:15)</a>:</h4>
<p>well I used <code>-Csave-temps</code> to get the <code>bc</code></p>



<a name="177983727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983727">(Oct 12 2019 at 11:15)</a>:</h4>
<p>I guess it might work but even if it did, what would I do with it?</p>



<a name="177983771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983771">(Oct 12 2019 at 11:16)</a>:</h4>
<p>I guess I can rebuild without <code>"always-verify-llvm-ir"</code> enabled</p>



<a name="177983778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983778">(Oct 12 2019 at 11:16)</a>:</h4>
<p>or maybe (better) hack the compiler to add a <code>Zno-verify-llvm-ir</code> option in that case :)</p>



<a name="177983780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983780">(Oct 12 2019 at 11:16)</a>:</h4>
<p>which is sort of what I want</p>



<a name="177983785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983785">(Oct 12 2019 at 11:17)</a>:</h4>
<p>Definitely sounds like the long term solution</p>



<a name="177983862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983862">(Oct 12 2019 at 11:19)</a>:</h4>
<p>the other thing I didn't try yet is <code>-Cno-prepopulate-passes</code></p>



<a name="177983864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983864">(Oct 12 2019 at 11:19)</a>:</h4>
<p>maybe that will skip the verify step?</p>



<a name="177983883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177983883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177983883">(Oct 12 2019 at 11:19)</a>:</h4>
<p>Quick skimming of the relevant code suggests no, but can't hurt to try</p>



<a name="177984014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984014">(Oct 12 2019 at 11:22)</a>:</h4>
<p>Oh. llvm-dis verifies by itself, it's not affected by rustc's <code>cfg(always_verify_llvm_ir)</code></p>



<a name="177984222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984222">(Oct 12 2019 at 11:28)</a>:</h4>
<blockquote>
<p>Oh. llvm-dis verifies by itself, it's not affected by rustc's <code>cfg(always_verify_llvm_ir)</code></p>
</blockquote>
<p>correct</p>



<a name="177984226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984226">(Oct 12 2019 at 11:28)</a>:</h4>
<p>and it has no option to disable it, from what I can tell</p>



<a name="177984228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984228">(Oct 12 2019 at 11:28)</a>:</h4>
<p>which seems...strange</p>



<a name="177984229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984229">(Oct 12 2019 at 11:28)</a>:</h4>
<p>like surely somebody else has had this same problem ;)</p>



<a name="177984352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984352">(Oct 12 2019 at 11:32)</a>:</h4>
<blockquote>
<p>or maybe (better) hack the compiler to add a <code>Zno-verify-llvm-ir</code> option in that case :)</p>
</blockquote>
<p>I'm doing this</p>



<a name="177984353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984353">(Oct 12 2019 at 11:32)</a>:</h4>
<p>not like it's hard</p>



<a name="177984356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/save-temps/near/177984356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/save-temps.html#177984356">(Oct 12 2019 at 11:32)</a>:</h4>
<p>I just didn't want to rebuild :P</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>